<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
*/

$app->get('/', function(){
	echo "welcome to ptime3team api.";
	
	// echo date("Y-m-d H:i:s");
});


$app->get  	('/user/{id}/team', 			'UserTeamController@index');
$app->post 	('/user/{id}/team/{tid}/stick',	'UserTeamController@stickStore');
$app->delete('/user/{id}/team/{tid}/stick',	'UserTeamController@stickDestroy');

$app->get 	('/team/recommend', 			'TeamRecommendController@index');
$app->post 	('/team/recommend', 			'TeamRecommendController@store');
$app->post 	('/team/recommend/{id}/agree', 	'TeamRecommendController@agree');

$app->get  	('/team', 						'TeamController@index');
$app->get 	('/team/{id}', 					'TeamController@show');
$app->post 	('/team', 						'TeamController@store');
$app->put 	('/team/{id}', 					'TeamController@update');
$app->delete('/team/{id}', 					'TeamController@destroy');
$app->get  	('/team/{id}/invite_code', 		'TeamController@inviteCodeShow');
$app->put 	('/team/{id}/invite_code/refresh', 'TeamController@inviteCodeRefresh');

$app->post 	('/team/{id}/inform', 			'TeamInformController@store');

$app->get 	('/team/{id}/user', 			'TeamUserController@index');
$app->post 	('/team/{id}/user/{uid}', 		'TeamUserController@store');
$app->delete('/team/{id}/user/{uid}',		'TeamUserController@destroy');
$app->post 	('/team/user/{uid}',        	'TeamUserController@joinwithcode');

$app->post 	('/team/{id}/user/{uid}/apply', 	'TeamUserController@apply');

$app->get 	('/team/{id}/user/{uid}/apply/agree', 		'TeamUserController@agreeApply');
$app->get 	('/team/{id}/user/{uid}/apply/disagree', 	'TeamUserController@disagreeApply');

$app->get 	('/team/{id}/user/invite/agree', 			'TeamUserController@agreeInvite');
$app->get 	('/team/{id}/user/invite/disagree', 		'TeamUserController@disagreeInvite');
